# 递归查找 main 目录下的所有 .c 文件
file(GLOB_RECURSE MAIN_SOURCES
    "${CMAKE_CURRENT_SOURCE_DIR}/*.c"
)

# 递归查找 ui 目录及其子目录下的所有 .c 文件
file(GLOB_RECURSE UI_SOURCES
    "${CMAKE_CURRENT_SOURCE_DIR}/ui/*.c"
    "${CMAKE_CURRENT_SOURCE_DIR}/ui/custom/*.c"
    "${CMAKE_CURRENT_SOURCE_DIR}/ui/generated/*.c"
    "${CMAKE_CURRENT_SOURCE_DIR}/ui/generated/guider_customer_fonts/*.c"
    "${CMAKE_CURRENT_SOURCE_DIR}/ui/generated/guider_fonts/*.c"
    "${CMAKE_CURRENT_SOURCE_DIR}/ui/generated/images/*.c"
)

# 合并所有源文件
set(MAIN_SOURCES
    ${MAIN_SOURCES}
    ${UI_SOURCES}
)

# 设置头文件路径
set(INCLUDE_DIRS
    .
    ui
    ui/custom
    ui/generated
    ui/generated/guider_customer_fonts
    ui/generated/guider_fonts
    ui/generated/images
)

# 注册组件
idf_component_register(
    SRCS ${MAIN_SOURCES}
    INCLUDE_DIRS ${INCLUDE_DIRS}
)

